import { BaseResModel } from "../dto";

/**
 * 流媒体平台基础模型
 */
export const PlatformModel = {
  pltId: {
    type: "number",
    description: "流媒体服务平台Id",
    example: 1001
  },
  pltName: {
    type: "string",
    description: "流媒体服务平台名称",
    example: "基础流媒体服务平台"
  },
  pltProtocol: {
    type: "string",
    description: "设备访问协议",
    enum: ["http", "https"],
    example: "http"
  },
  pltIp: {
    type: "string",
    description: "流媒体服务平台域名",
    example: "192.168.107.122"
  },
  pltPort: {
    type: "string",
    description: "流媒体服务平台端口",
    example: "8080"
  },
  pltSecret: {
    type: "string",
    description: "流媒体服务平台秘钥",
    example: "035c73f7-bb6b-4889-a715-d9eb2d1925cc"
  },
  pltState: {
    type: "string",
    description: "流媒体服务平台状态 1-启用 0-停用",
    example: "1",
    enum: ["1", "0"]
  },
  pltRemark: {
    type: "string",
    description: "备注",
    example: "备注"
  },
  createdAt: {
    type: "number",
    description: "创建日期",
    example: new Date().valueOf()
  },
  updatedAt: {
    type: "number",
    description: "修改日期",
    example: new Date().valueOf()
  }
};

/**
 * 流媒体平台操作模型，新增及修改
 */
export const PlatformOpReqModel = {
  pltName: {
    type: "string",
    required: true,
    description: "流媒体服务平台名称",
    example: "基础流媒体服务平台"
  },
  pltProtocol: {
    type: "string",
    required: true,
    description: "设备访问协议",
    enum: ["http", "https"],
    example: "http"
  },
  pltIp: {
    type: "string",
    required: true,
    description: "流媒体服务平台域名",
    example: "192.168.107.122"
  },
  pltPort: {
    type: "string",
    required: true,
    description: "流媒体服务平台端口",
    example: "8080"
  },
  pltSecret: {
    type: "string",
    required: true,
    description: "流媒体服务平台秘钥",
    example: "035c73f7-bb6b-4889-a715-d9eb2d1925cc"
  },
  pltState: {
    type: "string",
    description: "流媒体服务平台状态 1-启用 0-停用",
    example: "1",
    enum: ["1", "0"]
  },
  pltRemark: {
    type: "string",
    description: "备注",
    example: "备注"
  }
};

/**
 * 新增及修改相应模型
 */
export const PlatformOpResModel = {
  ...BaseResModel,
  data: {
    type: "number",
    description: "流媒体服务平台ID",
    example: 1001
  }
};
